package com.cat.myblog.article.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.cat.myblog.article.mapper.ArticleMapper;
import com.cat.myblog.article.service.ArticleService;
import com.cat.myblog.common.entity.Article;

import com.cat.myblog.common.utils.JsonUtil;
import com.cat.myblog.common.vo.ResponseResult;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

/**
* @author WGQ00
* @description 针对表【article(文章表)】的数据库操作Service实现
* @createDate 2025-01-12 22:53:20
*/
@Service
@AllArgsConstructor
public class ArticleServiceImpl extends ServiceImpl<ArticleMapper, Article> implements ArticleService {

    private ArticleMapper articleMapper;


    @Override
    public String articleInfo() {
         String str = JsonUtil.serialize(ResponseResult.success(articleMapper.articleInfo()));
        return str;
    }

    @Override
    public String listArticle(Page<Article> page) {
        String str = JsonUtil.serialize(ResponseResult.success(articleMapper.selectPage(page,null)));
        return str;
    }
}




